package zjut.cocouml.wizard.page;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.widgets.Composite;

import zjut.cocouml.wizard.ElementWizardSettings;

import static zjut.cocouml.constant.DialogStrings.*;
import static zjut.cocouml.wizard.ElementWizardSettings.*;

public class ModifyMethodWizardPage extends MemberSignatureWizardPage{
	
	public ModifyMethodWizardPage(String name,boolean isInterface) {
		super(name);
		this.setInterface(isInterface);
		this.setTitle(WIZARD_ADD_METHOD_TITLE);
		this.setDescription(WIZARD_ADD_METHOD_MESSAGE);
	}

	public void createControl(Composite parent) {
		super.createControl(parent);
		createMethodParameterControl();
		setTypeLabel(WIZARD_ADD_METHOD_TYPE);
		
	}
	
	protected boolean allowVoidType() {
		return false;
	}
	protected ElementWizardSettings getSetting() {

		System.out.println("ModifyMethodWizardPage : ElementWizardSettings : getSetting : isInterface = " +isInterface());
		System.out.println("ModifyMethodWizardPage : ElementWizardSettings : getSetting : isInterface = " +isInterface());

		return isInterface() ? InterfaceMethodSettings
				: ClassMethodSettings;
	}
	protected boolean isField() {
		return false;
	}
	
	private String newName;
	private String returnType;
	private String accessAuthrity;
	
	private boolean isFinal;
	private boolean isStatic;
	private boolean isAbstract;
	
	private String parameters;

	public void setNewName(String newName) {
		this.newName = newName;
	}

	public void setReturnType(String returnType) {
		this.returnType = returnType;
	}

	public void setAccessAuthrity(String accessAuthrity) {
		this.accessAuthrity = accessAuthrity;
	}

	public void setFinal(boolean isFinal) {
		this.isFinal = isFinal;
	}

	public void setStatic(boolean isStatic) {
		this.isStatic = isStatic;
	}

	public void setAbstract(boolean isAbstract) {
		this.isAbstract = isAbstract;
	}

	public void setParameters(String parameters) {
		this.parameters = parameters;
	}

}
